﻿@model IEnumerable<IRIS.Models.StaticPage>

@{
    ViewBag.Title = "Index";
}

@section SubMenu
{
    <ul id="submenu">
    @foreach(var item in Model)
    {
        <li>@Html.ActionLink(item.Title, "Details", new { id = item.Id })
        </li>
    }
    </ul>

}
<h2>Annað efni</h2>

<table>
    <tr>
        <th>
            Nafn
        </th>
        <th>
            Dagsetning 
        </th>
        <th>
            Síðast breytt
        </th>
       
         @if (User.IsInRole("Stjórnendur"))
         {
        <th></th>
             }
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.ActionLink(item.Title, "Details", new { id = item.Id })
        </td>
        <td>
            @Html.DisplayFor(Item => item.Created)
        </td>
        <td>
            @Html.DisplayFor(Item => item.Modified)
        </td>
            @if (User.IsInRole("Stjórnendur"))
            {
        <td>
    
            @Html.ActionLink("Breyta", "Edit", new { id = item.Id }) |            
            @Html.ActionLink("Eyða", "Delete", new { id = item.Id })
            
        </td>
            }
    </tr>
}
</table>